package misc
{
	public class c_ARRAY
	{
		public function c_ARRAY()
		{
		}
		
		/** sucht in einem array, welches nur zahlen-indizierte werte enthält, nach dem wert Value.
		 * INPUT: ARRAY_toSearch -> an array who's index is number-based.
		 * ELEMENT -> any kind of value
		 * RESULT_FORMAT -> 'boolean', 'wanted object'
		 * **/
		public function IN_ARRAY(ARRAY:Array,ELEMENT:*,RESULT_FORMAT:String = 'wanted object'):*
		{
			if(RESULT_FORMAT == 'wanted object')
			{
				var RESULT:* = null;
			}
			else if(RESULT_FORMAT == 'boolean')
			{
				var RESULT:* = false;
			}
			
			for(var counter:int = 0;!(counter == ARRAY.length);counter++)
			{
				if(ARRAY[counter] == ELEMENT)
				{
					if(RESULT_FORMAT == 'wanted object')
					{
						RESULT = ARRAY[counter];
					}
					else if(RESULT_FORMAT == 'boolean')
					{
						RESULT = true;
					}
					
					break;
				}
			}
			
			return RESULT;
		}
	}
}